package com.dongdongshop.config;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {

//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id ="2021000116679449";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCpwavzPP3MbSzXhcj2mQygSbVxMbdWEX/2bGVYxnw1V+rsEIgrOWNsMuD+hBqgEh5ptrq9U2A+Xrfyf5AqQxRLDGOKGyVNR8gTVWITQ5tQq3O2iW87hjYdlJc2JgPFKnSHkhwcV657lyFEdpZBZQo1OHb9WM2bIg8jKlKSED+6Zn1Ap0giL9lBkkm58GdWaSz3xJyoDwNiy3UQqW/644FOC6TsTtblVYD6ZG8XN9k8OcMXdDUf1n464HCyH+a/JmR+e3sca5B0InZJy2vJEhqTOTrg9TWiakCOccgy3IYzHaXk5RfQvtQQzARMtY4K7NSjEUl6nfN20B/fav+RsrLBAgMBAAECggEATXQOTocPjcxqX1OtY8ZlGmVHIgR7EAwgBIFkpGK7nWMlztukJYSjtmRof/gqZcqekcFL5sI58XsqFrzZPE8q3Ssj54mHNYGA6kFU5FE+dkokG68NT21nF4wKiixCIB3E2W5y4QOomr9T8HbjC6dcRvgiYmm4NgYOPg87aWV8jkEicgd2wx8d1REISMSMwXfZtQRjD1TlCVBzNf4mWPR44BA0gQ8iAgDz9BVHDTsoueIWsonZ9GWVT1VMmfV9kxC6EEalIWcMBE70LiQ8xB3a1vjIbdzs+7UrXyhOHNQMiyGum2ODqlzbEgxNuVP8WbMhu2HqbQgIzKawRecX0oLfoQKBgQDcZ1Iq7nQBlEZlV4o6bYaq4FXaMm9VKSYLvo6aLJE/kVOsDduufXeNYwDejcQ4HOET13/zaIOhl5jlZ1fsTLF0zbHzRPk5XHvsS0x6Nb+Z+/Bj+2BFuT72Ucq/tQPUTqOQ3XpsXGx0M9Wc1sqxZzs5Xu461MpWDXmev2dZfyqGfQKBgQDFLFOVWKsSQHUyiJwQeAqq8EoiOoRVJtDQDXLcC9X3HMAD0QvDLy7WzKWUYplD5ekF60c2I5xn7B0hyfvzC52pSn2hl/Rbaa02cY5hZnBJlgmt5lc4VYCjDI7PmcFCagxhP+cxgh49siCLePwfzAWdZu7egg22nC3mF4tDFwvclQKBgBPQpi596agKsJmD2UWPez/5kz5esmuxm14K778kqppQcnlRdaKmXQ01DWr0y+NPlVy3TyWPC+aHPpPBSsJP0tRxecIpPU7O5cVEr8d89ZDeeapDe1BJa0Ox7sx1dbasqz/m6Y68cHOyBU5ocSip40UxJ7HaV6aM55ZCFwSQzj3xAoGAFCFhazcBSDzCemVOIbRPyoH736C/z/3FhehJmMOwlakexYT7QXM4wf9kzFCAu1jmwI7z10gteMK3erKngXnnH9iWGQBtl0OjxpIzaihOQIUL+fAxaXP5TSxEDFfzTjeLigY/MWPKeJwODI9OlmR7EkXnD1qR0doCKaKvuirJMD0CgYEAywO3xi6bd0fApoKZSjcyeAC4/6qGAHWsp4J2VsX4OgT69I1wtyuBYS80R1nUOwRjKoigc0h7V1UJn79xHx1QhBa/hBitcscalockeSJm2d3+Ce+jNrfVjvgZrV6QtEHawY5Lbf8rN6muyw+/1zhk/zBCRfpfWgvJIPF9urwTM7A=";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAj18ZwNu+/ofvmSnurJhErBnkmmVZLO5Ps8xGjXWB587bJGN2r3AnR3ijxyAJ8mpZpbIFpxGFHuBQ9xgdtaOLis7W/cOIwbwrr2Ew4t+9sRsAHRw19VNfU0wuyLz3T1KeWGeeCcOPMms5K33Hl0/Ej1I8VO/KW6RstpLirnGWvhAgERXVAh5i9CYvRpn5ttMFyVrHXy12LDRpUpR+v5XfD5muQChFxci/HWJcjrnw4MsVZf806jXTM94Oq54QclblX+gGGASbpcIuwdh2MrXKEaFP0OgNiP9ELCDk8iejiu/XDrOWbtXoMo7jdZojXBU19vXXvjURPTsFNtCJ6psxZwIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://363i17i771.wicp.vip/trade/notifyUrl";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://363i17i771.wicp.vip/trade/returnUrl";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

    // 支付宝日志
    public static String log_path = "E:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

